using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SwitchSprite:MonoBehaviour {

	[SerializeField] Sprite[] spriteByFlag;

	private void Update() {
		int flag = GetComponent<InteractionTarget>().flag;
		if(flag<spriteByFlag.Length) GetComponent<SpriteRenderer>().sprite=spriteByFlag[flag];
	}

}
